package org.newlucene.core.index;

import org.newlucene.core.document.Field;

final class FieldInfo 
{
	String name;
	int number;
	int config;
	
	// pre-computed for efficiency
	private boolean isFrq = false;
	private boolean isPos = false;
	private boolean isStore = false; 

	FieldInfo(String name, int number, int config) 
	{
		this.name = name;
		this.number = number;
		this.config = config;
		
		this.isFrq = (config & Field.FRQ) == Field.FRQ;
		this.isPos = (config & Field.POS) == Field.POS;
		this.isStore = (config & Field.STORE) == Field.STORE;
	}
	
	public int getFieldConfig()
	{
		return config;
	}
	
	// see if frq is indexed
	public boolean isFrq()
	{
		return this.isFrq;
	}
	
	public boolean isPos()
	{
		return this.isPos;
	}
	
	public boolean isStore()
	{
		return this.isStore;
	}
}
